package cs2114.antiFingerMines;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

// -------------------------------------------------------------------------
/**
 *  This class tests the location calss
 *
 * @author Blake Whaley
 * @author Graham McLaughlin (gjm1324)
 * @author William Vuong (wnvuong)
 * @version 2012.29.4
 */
public class LocationTest
{

    /**
     * Location variable
     */
    Location loc;

    // ----------------------------------------------------------
    /**
     * This sets up the location to be tested
     */
    @Before
    public void setUp()
    {
        loc = new Location(12, 15);
    }

    /**
     * Tests the getXloc method
     */
    @Test
    public void testGetXloc()
    {
        assertEquals(12.0, loc.getXloc(), .0001);
    }

    /**
     * Tests the getYloc method
     */
    @Test
    public void testGetYloc()
    {
        assertEquals(15, loc.getYloc(), .0001);
    }

    /**
     * Tests the setXloc method
     */
    @Test
    public void testSetXloc()
    {
        loc.setXloc(29);
        assertEquals(29, loc.getXloc(), .00001);
    }

    /**
     * Tests the setYloc
     */
    @Test
    public void testSetYloc()
    {
        loc.setYloc(40);
        assertEquals(40, loc.getYloc(), .0001);
    }

}
